//这个模块主要获取品牌管理的数据的模块
import request from '@/utils/request';

//获取品牌列表接口
// /admin/product/baseTrademark/{page}/{limit}
export const reqTradeMarkList = (page, limit) => request({
    url: `/admin/product/baseTrademark/${page}/${limit}`,
    method: 'get'
});

//新增商品
//修改商品
export const reqUpdateOrAddTradeMark = (tradeMark) => {
    //带给服务器数据携带ID---修改
    if (tradeMark.id) {
        //修改商品
        return request({ url: "/admin/product/baseTrademark/update", method: 'put', data: tradeMark })
    } else {
        //新增商品
        return request({ url: '/admin/product/baseTrademark/save', method: 'post', data: tradeMark })
    }
}

//删除品牌
export const reqDeleteTradeMark = (id) => request({
    url: `/admin/product/baseTrademark/remove/${id}`,
    method: 'delete'
})